#ifndef DEMO11_H
#define DEMO11_H
#include <string>
using namespace std;

class demo11_basic
{
public:
    demo11_basic() = default;
    demo11_basic(const std::string &book, double sales_price) : bookNo(book), price(sales_price) {}
    string isbn() const { return bookNo; }
    virtual double net_price(size_t n) const { return n * price; }
    virtual ~demo11_basic() = default;

private:
    string bookNo;

protected:
    double price = 0.0;
};

class demo11_inherit : public demo11_basic
{
public:
    demo11_inherit() = default;
    demo11_inherit(const string &a, double b, size_t c, double d) : demo11_basic(a, b), discount(d) {}
    double net_price(size_t) const override;

private:
    double discount = 0.0;
};
// 含有纯虚函数，属于抽象类

#endif
